<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<base href="<%=basePath%>">
<meta content="IE=11.0000" http-equiv="X-UA-Compatible">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<meta name="keywords" content="IEC,微圈,导员在线,zzuli,国际教育学院,郑州轻工业学院,IEC微圈">
<meta name="description" content="IEC微圈是郑州轻工业学院国际教育学院推出的，为辅导员提供信息发布和学生及时接收信息的平台">
<meta name="author" content="郑州轻工业学院大学生IT创新工作室">
<meta name="robots" content="index,follow">
<meta name="application-name" content="iec微圈">
<link href="fonts/glyphicons-halflings-regular.svg" rel="shortcut icon">
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/carousel.css" rel="stylesheet">
<link href="css/table.css" rel="stylesheet">
<link href="img/icon.png" rel="icon">
<!-- html5 shim and Respond.js IE8 support of html5 elements and media queries -->
<!--[if lt IE 9]>
      <script src="../../docs-assets/js/html5shiv.js"></script>
      <script src="../../docs-assets/js/respond.min.js"></script>
    <![endif]-->
<title>导员发布</title>
</head>
<body>
<div class="navbar-wrapper">
  <div class="container">
    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
          <a class="navbar-brand" href="index.html"> <img alt="Brand" src="img/logo.png"></a> </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
            <li><a href="index.action">&nbsp;首&nbsp;页&nbsp;</A></li>
            <li><a href="news_teacher.action">&nbsp;总&nbsp;帖&nbsp;</A></li>
            <li><a href="user_teacher.action">&nbsp;关&nbsp;注&nbsp;</A></li>
           <li class="active"> <a href="#"><%=session.getAttribute("name")%></a> </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</div>
<form method="post" id ="delForm">
<div id="myModal" class="modal fade " tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"data-backdrop="static" >
  <div class="modal-dialog ">
    <div class="modal-content">
      <div class="modal-header">     
        <br>
      <div class="modal-body">
        <p id="title_p">新版本上传成功！&hellip;</p>
      </div>
        <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
      </div>
      </div>
    </div>
  </div>
</div>
</form>
<div class="container" style="margin-bottom:20px"> <br>
  <div class="row">
    <div class="col-lg-1"></div>
    <div class="col-lg-2 bkgd"> <br>
      <div class="center-block">
        <center>
          <img class="img-circle" alt="Generic placeholder image"   src="img/tou.png" width="120px" height="120px">
        </center>
      </div>
      <br>
      <div class="center-block">
        <p class="text-center"><strong><%=session.getAttribute("name")%></strong></p>
      </div>
      <div class="col-lg-2"></div>
      <div class="col-lg-12">
        <ul class="nav nav-pills nav-stacked" role="tablist">
          <br>
          <li><a href="admin_addnotice.action"> &nbsp;发布公告</a></li>
          <li><a href="admin_addPublic.action">&nbsp;开通账号</a> </li>
          <li><a href="manage_adTeacher.action">&nbsp;发布管理 </a> </li>
          <li><a href="home_update.action">&nbsp;更新首页 </a> </li>
          <li class="active"> <a href="app_toUpdate.action">&nbsp;版本更新 </a> </li>
          <li><a href="opinion_list.action">&nbsp;意见反馈</a> </li>
          <li><a href="admin_account.action">&nbsp;账号管理</a></li>
          <li class="bd"><a href="user_logout.action"> &nbsp;退出登录</a></li>
         </ul>
      </div>
    </div>
    <div class="col-lg-8"> 
      <!--Content 发帖框-->
      <div class="col-lg-2 " style="padding-bottom:5px;" >
        <label class="btn-primary" style="padding-right:10px">
        <h4> &nbsp;&nbsp;更新app</h4>
        </label>
      </div>
	   <div class="col-lg-12">
	 <form class="form-horizontal" role="form" method="post" id="update_form" enctype="multipart/form-data">
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="formGroupInputLarge" >版&nbsp;&nbsp;本&nbsp;&nbsp;号：</label>
          <div class="col-sm-9">
           <input type="text" class="form-control input-lg" placeholder="浮点数" id="version" name="version"  >
          </div>
       </div>
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="formGroupInputLarge" >app&nbsp;&nbsp;&nbsp;&nbsp;：</label>
          <div class="col-sm-9">
            <input  type="file" name="file" id="myfile" class="form-control btn file"/>
          </div>
       </div>
	  <div class="col-lg-2"></div>
	  <div>
			<button type="button"  class="btn btn-primary col-lg-3" onclick="update()">上传app</button>  	
	  </div>
	 </form>
	</div>
    </div>
  </div>
</div>
<div class="footerwarp">
  <footer >
    <hr>
   <p class="text-center">© 2014 郑州轻工业学院国际教育学院版权所有 <a href="about.action"><span>关于我们</span></a>
     <a href="admin_come.action"> <span>管理入口</span></a></p>
  </footer>
</div>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script> 
<script src="js/footer.js"></script>
<script type="text/javascript">
function update(){
	var form  =document.getElementById("update_form");
	var version = document.getElementById("version").value; // js 获取文件对象	
	var fileObj = document.getElementById("myfile").files[0]; // js 获取文件对象
	var reg  = /^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/;
	if(fileObj.name.indexOf(".apk")<0 || !reg.test(version)){
		return false;
	}
	else{
		form.action=action ="app_update.action"+"?version="+version;
		form.submit();
	}
}
</script>
<s:if test="#parameters.num[0]=='success'">
	<script>
	
 	 $('#myModal').modal('show') ;
 </script>
</s:if>
<s:if test="#parameters.num[0]=='fail'">
	<script>
	$('#title_p').html('上传失败');
 	 $('#myModal').modal('show') ;
 </script>
</s:if>
</body>
</html>
